home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / Looching2.0 / Stopit.m < prev   
Encoding:
Text File  |  1990-02-02  |  312 b   |  29 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #include <libc.h>
  5. #include <strings.h>
  6.  
  7. extern int Pid;
  8.  
  9. #import "Stopit.h"
  10.  
  11. @implementation Stopit
  12.  
  13. - terminate:sender
  14. {
  15.     if (Pid > 0) {
  16.         char s[10] = "kill ";
  17.         char num[10];
  18.  
  19.         sprintf(num,"%d",Pid);
  20.         strcat(s,num);
  21.         system(s);
  22.         }
  23.  
  24.     [super terminate:self];
  25. }
  26.  
  27.  
  28. @end
  29.